/**
 * @file   testTime.cpp
 * @author wolfhead <wolfhead@wolfhead-laptop>
 * @date   Wed Aug 24 10:54:20 2011
 * 
 * @brief  
 * 
 * 
 */
#include "gtest/gtest.h"
#include <acapella/util/time.hpp>
#include <acapella/string/string_util.hpp>

TEST(TimeTest, GetMilliTimeValTimeTest)
{
    using namespace acapella::util;
    using namespace acapella;

    Time::MilliSecond ms = Time::GetMilliSecond();

    printf("%s", StringUtil::ToString(ms).c_str());
}

TEST(TimeTest, GetTimeValTimeTest)
{
    using namespace acapella::util;
    using namespace acapella;

    Time::TimeVal sec = Time::GetTimeVal();

    printf("%s", StringUtil::ToString(sec).c_str());
}

TEST(TimeTest, GetGreenwishStartTest)
{
    using namespace acapella::util;
    using namespace acapella;

    Time::TimeVal sec = Time::GetGreenwishStart();

    printf("%s", StringUtil::ToString(sec).c_str());
}

TEST(TimeTest, FormatTest)
{
    using namespace acapella::util;
    using namespace acapella;

    printf("%s", Time::Format<255>("%Y-%m-%d", Time::Now()).c_str());
}


TEST(TimeTest, ParseTest)
{
    using namespace acapella::util;
    using namespace acapella;

    std::string current = Time::Format<255>("%Y-%m-%d %H:%M:%S");
    Time::TimeVal sec = Time::Parse(current.c_str(), "%Y-%m-%d %H:%M:%S");

    printf("%s", StringUtil::ToString(sec).c_str());
}


